1. Field
The disclosure relates to a method, system, and article of manufacture for maintaining a mirrored file system for performing defragmentation.
2. Background
Locality of reference may cause related storage locations to be sequentially accessed in a file system. Often when an application starts to read a file, the application may read the entire file. In such a situation, it may be desirable to maintain the entire file in contiguously located space in a storage device.
A file system may undergo fragmentation, when the file system is unable to allocate enough contiguous space to store a complete file as a unit. In such a situation, the file system may place parts of the file in gaps between other files. These gaps may exist because they formerly held a file that the operating system has subsequently deleted, or because the file system allocated excess space for the file in the first place. Larger files and greater numbers of files also contribute to fragmentation and consequent loss of performance.
A fragmented file system may cause a degradation of performance while satisfying input/output (I/O) operations from applications. In a fragmented file system locality of reference of data may not be preserved, and the I/O patterns on the storage devices may become more random than sequential.
In the maintenance of file systems, defragmentation is a process that reduces the amount of fragmentation. Defragmentation physically organizes the contents of the mass storage device used to store files into a number of contiguous regions. It also attempts to create larger regions of free space by using compaction to impede the return of fragmentation. Defragmentation consolidates the data of files to store the data in contiguous space and reduces the fragmentation problem, and as a result improves I/O performance. Although defragmentation in contemporary file systems does not require applications to stop execution, defragmentation is time consuming and affects the performance of applications.